#ifndef VL_SERIALIZE_HPP
#define VL_SERIALIZE_HPP

#include "fixed.hpp"
#include "vec.hpp"

namespace vl
{

struct stream;
struct buffer;

template<typename T>
struct basic_vec;

void write(vl::stream& dest, vl::fixed v);
bool read(vl::stream& dest, vl::fixed& v);

template<typename T>
void write(vl::stream& dest, vl::basic_vec<T> const& v)
{
	write(dest, v.x);
	write(dest, v.y);
}

template<typename T>
void read(vl::stream& dest, vl::basic_vec<T>& v)
{
	read(dest, v.x);
	read(dest, v.y);
}


}

#endif //VL_SERIALIZE_HPP
